//
//  AGDChatViewController.h
//  AgoraDemo
//
//  Created by apple on 15/9/9.
//  Copyright (c) 2015年 Agora. All rights reserved.
//

#import <UIKit/UIKit.h>

#import <AVFoundation/AVFoundation.h>

#import "AGDChatCell.h"
#import <AgoraRtcEngineKit/AgoraRtcEngineKitEx.h>
#import <AgoraRtcEngineKit/AgoraRtcEngineKit.h>


@interface AGDChatViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegate, AgoraRtcEngineExtensionDelegate, AVCaptureVideoDataOutputSampleBufferDelegate>


@property (nonatomic, strong) AVCaptureSession* session;
@property (nonatomic, strong) AVCaptureVideoPreviewLayer* previewLayer;
@property (nonatomic, strong) AVCaptureVideoDataOutput* videoOutput;
@property (nonatomic, strong) dispatch_queue_t videoQueue;
@property (nonatomic, strong) dispatch_queue_t audioQueue;
@property (nonatomic, strong) AVCaptureConnection* audioConnection;
@property (nonatomic, strong) AVCaptureConnection* videoConnection;

-(void)subVideoDataReceived:(CVPixelBufferRef) pixelBufferRef
                   widthTag:(int) width
                  heightTag:(int) height;

- (CVPixelBufferRef) createI420BiPlanarPixelBuffer:(uint8_t *) data andLength:(int )length andWidth:(int )width andHeight:(int )height;


- (void) gotAudioFrameWithData:(uint8_t*)data Size:(size_t)size InNumberFrames:(int)inNumberFrames local:(bool)isLocal ;


@property(nonatomic,retain) NSDictionary *dictionary;

@property (assign, nonatomic) AGDChatType chatType;

@end

static NSString * const AGDKeyChannel = @"Channel";
static NSString * const AGDKeyVendorKey = @"VendorKey";
